<div class="modal fade in ip-box" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true" id="edit" *ngIf="initService.init&&details&&serviceTypeInfo">
    <div class="modal-dialog modal-lg-f modal-lg-f-105" role="document" style="margin:254px auto;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" 
                            class="close" 
                            data-dismiss="modal" 
                            aria-hidden="true"
                            (click)="initService._init()"
                            >×
                    </button>
                    <h4 class="modal-title" id="myModalLabel">授权范围管理 — 修改</h4>
                </div>
                <div class="modal-body">
                    <form #editForm="ngForm" (ngSubmit)="_onSubmit(editForm.value)">
                        
                        <input type="text" 
                               name="scopesId" 
                               class="hide" 
                               #terminalId="ngModel" 
                               [ngModel]="details.scopesId"
                               >

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right">资源服务编码：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                	   name="scopesCode" 
                                	   class="form-control"
                                       autocomplete="off" 
                                       required
                                       maxlength="25"
                                       pattern="^[a-zA-Z_\s]*$"
                                	   #scopesCode="ngModel"
                                       [ngModel]="details.scopesCode"
                                       placeholder="请输入资源服务编码"
                                	   >
                                <label class="red required">*</label>
                                <div class="error" *ngIf="scopesCode.invalid && (scopesCode.touched)">
                                    <small class="error" *ngIf="scopesCode.errors.required">请输入资源服务编码</small>
                                    <small class="error" *ngIf="scopesCode.errors.pattern">资源服务编码格式不对</small>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right">资源服务名称：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="scopeName" 
                                       class="form-control"
                                       autocomplete="off" 
                                       required
                                       maxlength="25"
                                       #scopeName="ngModel"
                                       placeholder="请输入资源服务名称"
                                       [ngModel]="details.scopeName"
                                       >
                                <label class="red required">*</label>
                                <div class="error" *ngIf="scopeName.invalid && (scopeName.touched)">
                                    <small class="error" *ngIf="scopeName.errors.required">请输入资源服务名称</small>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right">资源服务URL：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="scopeUri" 
                                       class="form-control"
                                       autocomplete="off" 
                                       placeholder="请以http://(https://或ftp://)开头"
                                       required
                                       maxlength="150"
                                       pattern="(http|ftp|https):\/\/([\w.]+\/?)\S*"
                                       #scopeUri="ngModel"
                                       [ngModel]="details.scopeUri"
                                       >
                                <label class="red required">*</label>
                                <div class="error" *ngIf="scopeUri.invalid && (scopeUri.touched)">
                                    <small class="error" *ngIf="scopeUri.errors.required">请输入资源服务URL</small>
                                    <small class="error" *ngIf="scopeUri.errors.pattern">资源服务URL不正确</small>
                                </div>
                            </div>
                        </div>
						
						<div class="form-group height-auto">
							
							<div class="form-group height-auto" *ngIf="serviceTypeInfo">
	                            <label class="col-xs-12 col-sm-3 control-label text-right">服务类型：</label>   
	                            <div class="one-line col-xs-12 col-sm-3">
	                                <select id="serviceTypeEdit"
                                            name="serviceType" 
                                            style="width:120px !important;" 
                                            required 
                                            #serviceType
                                            [ngModel]="details.serviceType"
                                            (change)="_serviceTypeName()"
                                            >
	                                    <option *ngFor="let item of serviceTypeInfo" 
                                                [value]="item.sysValue"
                                                >{{ item.displayName }}
                                        </option>
	                                </select>
                                    <div class="error" *ngIf="serviceType.invalid && (serviceType.touched)">
                                        <small class="error" *ngIf="serviceType.errors.required">请选择服务类型</small>
                                    </div>
	                            </div>

	                            <label class="one-line col-xs-12 col-sm-3 control-label text-right">资源类型：</label>   
	                            <div class="col-xs-12 col-sm-3">
	                                <select name="scopeType" 
                                            required 
                                            #scopeType
                                            [ngModel]="details.scopeType"
                                            >
	                                 	<option value="0">系统资源</option>
	                                 	<option value="1">用户资源</option>
	                                </select>
                                    <div class="error" *ngIf="scopeType.invalid && (scopeType.touched)">
                                        <small class="error" *ngIf="scopeType.errors.required">请选择资源类型</small>
                                    </div>
	                            </div>
	                        </div>

						</div>

                        <div class="form-group height-auto">
                            <label class="col-xs-12 col-sm-3 control-label text-right">描述：</label>
                            <div class="col-xs-12 col-sm-9">
                                <textarea rows="5" 
                                		  type="text" 
                                		  name="description" 
                                          class="form-control" 
                                          placeholder="描述"
                                          [ngModel]="details.description"
                                		  >                                    
                                </textarea>
                                
                            </div>
                        </div>

                        <div class="modal-footer modal-footer-tongy">
                            <button type="button" 
                                    class="btn btn-fff" 
                                    data-dismiss="modal"
                                    (click)="initService._init()"
                                    >取消
                            </button>
                            <button type="submit" 
                                    class="btn btn-primary" 
                                    [disabled]="editForm.invalid||editForm.pristine"
                                    ><span class="glyphicon glyphicon-pencil"></span> 修改
                            </button>
                        </div>
                        
                    </form>

                </div>
            </div>
        </div>
</div>

